'''
Created on 02/03/2009

@author: eh01
'''

xmlVersionTag = '<?xml version="1.0" ?>'
messagesOpeningTag = '<messages>'
messagesClosingTag = '</messages>'
messageOpeningTag = '<message>'
messageClosingTag = '</message>'
idOpeningTag = '<id>'
idClosingTag = '</id>'

def getMessagesIdsXML(messages):
    xml = xmlVersionTag + messagesOpeningTag
    for message in messages:
        xml += idOpeningTag + str(message.key().id()) + idClosingTag
    xml += messagesClosingTag
    return xml           

def getMessageXML(message):
    return xmlVersionTag + message.body
    
def getMessageIdXML(message):
    return messageOpeningTag + idOpeningTag + str(message.key().id()) + idClosingTag + messageClosingTag
